package com.qyhl.shop.shop.coupon;

import com.qyhl.webtv.commonlib.entity.shop.ShopCouponBean;

import java.util.List;

public class ShopCouponListPresenter implements ShopCouponListContract.ShopCouponListPresenter {
    private ShopCouponListContract.ShopCouponListView mView;
    private ShopCouponListModel mModel;

    public ShopCouponListPresenter(ShopCouponListContract.ShopCouponListView mView) {
        this.mView = mView;
        this.mModel = new ShopCouponListModel(this);
    }

    @Override
    public void getList(int page) {
        mModel.getList(page);
    }

    @Override
    public void getCoupon(String phoneNum, int couponId, String sign) {
        mModel.getCoupon(phoneNum, couponId, sign);
    }

    @Override
    public void setList(List<ShopCouponBean> beanList) {
        if (beanList == null || beanList.size() < 1) {
            mView.setList(null);
        } else {
            mView.setList(beanList);
        }
    }

    @Override
    public void setError(String msg) {
        mView.setError(msg);
    }

    @Override
    public void getCouponResult(String msg) {
        mView.getCouponResult(msg);
    }
}
